<!DOCTYPE html>
<html lang="zh_CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>彼特列特群岛</title>
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

    <link rel="stylesheet" href="<?php echo base_url();?>application/views/blog.css">
    <!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">

    <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>

    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
    <script src="https://cdn.bootcss.com/vue/2.2.2/vue.min.js"></script>
</head>
<body>
<div class="container">
    <div class="title">
        <p id="bt">{{ bt }}</p> <a href="/">返回首页</a>
        <div style="clear: both;"></div>
    </div>

    <input id="showid" type="hidden" name="field"  value="<?=$id?>" v-model="showid"/>

    <div class="content" id="nr">
        {{ nr }}
    </div>
</div>
</body>
<script>
var vum =new Vue({
    el: "#bt",
    data: {
        bt: "",
    },
})
var vum2 = new Vue({
    el: '#nr',
    data: {
        nr: ''
    }
})
jQuery(function () {
    loadData();
})
function loadData() {
    showid = $("input:hidden[name='field']").val();
    jQuery.ajax({
        type: 'Get',
        dataType:"json",
        url: "http://127.0.0.4/index.php/blogApi/one/"+showid,
        success: function (data) {
            vum.bt = data.title;
            vum2.nr = data.content;
        }
    })
}
</script>
</html>    